package ch.rheintalconnection.sysventory.businessServices;

import org.apache.log4j.Logger;

import ch.rheintalconnection.sysventory.domain.Scan;
import ch.rheintalconnection.sysventory.technicalServices.IDataWriter;

public class ScanningService {
	
	private NetworkScanner networkScanner;
	private IDataWriter dataWriter;
	private Logger logger;

	public ScanningService(NetworkScanner networkScanner,
			IDataWriter dataWriter) {
		
		this.networkScanner = networkScanner;
		this.dataWriter = dataWriter;
	}
	
	public Scan scanAndStore() {
		
		Scan scan = networkScanner.scan();
		dataWriter.store(scan);
		
		return scan;
	}

}
